﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace SimpleExcel.Core.Extensions
{
    public static class ListExtension
    {
        public static MemoryStream ToMemoryStreamExcel<T>(this List<T> values) where T:class,new()
        {
            return ExcelCore.ToMemoryStream<T>(values);
        }

        public static byte[] ToByteExcel<T>(this List<T> values) where T : class, new()
        {
            using (var memoryStream = ExcelCore.ToMemoryStream<T>(values))
                return memoryStream.ToArray();
        }
    }
}
